//
import { title } from '@/settings'
import request from '@/utils/request.js'

export default {
	getAllArticles(currentPage, pageSize) {
		return request({
			url: `/article/getAllArticles/${currentPage}/${pageSize}`,
			method: "GET"
		})
	},

	getPageData(article, currentPage, pageSize) {
		return request({
			url: `/article/getPageData/`,
			method: 'GET',
			params: {
				'title': article.title,
				'userId': article.userId,
				'categoryId': article.categoryId,
				currentPage,
				pageSize
			}
		})
	},
	getArticlesById(id) {
		return request({
			url: `/article/getArticlesById/${id}`,
			method: "GET"
		})
	},

	delArticleById(id) {
		return request({
			url: `/article/delArticleById/${id}`,
			method: "GET"
		})
	},

	addArticle(articleList) {
		return request({
			url: `/article/addArticle`,
			method: "POST",
			data: articleList
		})
	}
}